package jp.sourceforge.akjrcp.tools;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;

import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class OtherToolsSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {

	public static final String PATH_ASCII_TEMPORARY="videotools.ascii_tmpdir";
	public static final String PATH_IMAGEMAGICK_CONVERT="imagetools.imagemagick_convert";
	public static final String PATH_IMAGEMAGICK_MONTAGE="imagetools.imagemagick_montage";
	public OtherToolsSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("othertools.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		
		addField(new DirectoryFieldEditor(PATH_ASCII_TEMPORARY,Messages.getString(PATH_ASCII_TEMPORARY),getFieldEditorParent()));
		  
		 FileFieldEditor filefield;
		  
		  filefield=new FileFieldEditor(
				  PATH_IMAGEMAGICK_CONVERT, Messages.getString("imagetools.imagemagick_convert"),getFieldEditorParent()); //$NON-NLS-1$
		  filefield.setFileExtensions(new String[]{"convert.exe"}); //$NON-NLS-1$
		  addField(filefield);
	      
		  filefield=new FileFieldEditor(
				  PATH_IMAGEMAGICK_MONTAGE, Messages.getString("imagetools.imagemagick_montage"),getFieldEditorParent()); //$NON-NLS-1$
		  filefield.setFileExtensions(new String[]{"montage.exe"}); //$NON-NLS-1$
		  addField(filefield);

	}

	public void init(IWorkbench workbench) {
		// TODO Auto-generated method stub
		
	}

}
